import java.util.ArrayList;

/**
 * This class represents a shop containing items
 * 
 * @author samkim
 *
 */
public class Shop {
	private GameSystem system;
	private ArrayList<Item> itemList;
	
	public Shop(GameSystem system) {
		this.system = system;
		this.itemList = new ArrayList<Item>();
		initialize();
	}
	
	public void initialize() {
		itemList.add(new Item(Item.ItemType.none));
		itemList.add(new Item(Item.ItemType.binoculars));
		itemList.add(new Item(Item.ItemType.mine_detector));
		itemList.add(new Item(Item.ItemType.medicine));
		itemList.add(new Item(Item.ItemType.macbook_air));
		itemList.add(new Item(Item.ItemType.boots));
		itemList.add(new Item(Item.ItemType.wire_cutters));
	}
	
	public ArrayList<Item> getItemList() {
		return this.itemList;
	}
	
	/**
	 * Adds item to the list of items
	 * @param item
	 */
	public void addItem(Item item) {
		itemList.add(item);
	}
	
	/**
	 * Updates party's water
	 * @param amount
	 */
	public void buyWater(int amount) {
		system.getParty().updateWater(amount);
	}
	
	/**
	 * Updates party's food
	 * @param amount
	 */
	public void buyFood(int amount) {
		system.getParty().updateFood(amount);
	}
	
	public void buyAmmunition(int amount) {
		system.getParty().updateAmmunition(amount);
	}
}
